package com.ujson.chat.common.exception;

import com.ujson.base.common.enums.ErrorCode;
import lombok.Data;

@Data
public class ChatException extends RuntimeException {
    private String message;
    private ErrorCode errorCode;
    private Throwable throwable;
    public ChatException(ErrorCode errorCode) {
        this.errorCode = errorCode;
        this.message = errorCode.getMsg();
    }
    public ChatException(String message) {
        super(message);
        this.message = message;
    }

    public ChatException(Throwable ex) {
        super(ex);
        this.throwable = ex;
    }

    public ChatException(String message, Throwable ex) {
        super(message, ex);
        this.message = message;
        this.throwable = ex;
    }

}
